#include "ThreadPool.hpp"
#include <memory>
#include <functional>
#include "Task.hpp"

using func_t = std::function<void(std::string name)>; // 可调用对象的类型
using namespace LogMudule;
using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG();
    ThreadPool<func_t>::getInstance()->Start();
    int cnt = 10;
    while (cnt)
    {
        ThreadPool<func_t>::getInstance()->Equeue(Push);
        cnt--;
        sleep(1);
    }
    ThreadPool<func_t>::getInstance()->Stop();
    ThreadPool<func_t>::getInstance()->Wait();
    /*std::shared_ptr<ThreadPool<func_t>> tp = std::make_shared<ThreadPool<func_t>>();
    tp->Start();

    int cnt = 10;
    while(cnt)
    {
        tp->Equeue(Push);
        cnt--;
        sleep(1);
    }

    tp->Wait();*/

    return 0;
}